using DevExpress.Utils;
using DevExpress.XtraBars;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraEditors.Repository;
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Views.Grid;
using Common.Class;
using Common.DS;
using Common.UI;
using System;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
using APP.HELPER.Data.Helper;
namespace Common.Base
{
	public class XucBaseBarD : XucBase
	{
		public delegate void StockChangedEventHander(object sender, object value);
		private IContainer components = null;
		protected ImageCollection img;
		private PanelControl plMain;
		private GridLookUpEdit txtStock;
		private GridView ucLookView;
		private BindingSource sTOCKBindingSource;
		private dsSTOCK dsSTOCK;
		private STOCKTableAdapter sTOCKTableAdapter;
		private GridColumn colStock_Name;
		private GridColumn colStock_ID;
		private XucTextEdit txtProduct_ID;
		private XucTextEdit txtProduct_Name;
		private PanelControl plStock;
		private PanelControl plProduct_ID;
		private PanelControl plProduct_Name;
		private PanelControl plFrom;
		protected DateEdit dtFrom;
		private LabelControl lblFrom;
		private PanelControl plTo;
		protected DateEdit dtTo;
		private LabelControl lblTo;
		private XucToolBarD ucBar;
		private XucDateTimeSelectEdit txtSelectDate;
		private bool _isfrom;
		private bool _isto;
		private bool _all;
		public event ButtonClickEventHander ExportClick;
		public event ButtonClickEventHander AddClick;
		public event ButtonClickEventHander EditClick;
		public event ButtonClickEventHander ChangeClick;
		public event ButtonClickEventHander DeleteClick;
		public event ButtonClickEventHander DeleteAllClick;
		public event ButtonClickEventHander RefreshClick;
		public event ButtonClickEventHander PrintClick;
		public event ButtonClickEventHander CloseClick;
		public event ButtonClickEventHander OptionClick;
		public event ButtonClickEventHander SaveClick;
		public event ButtonClickEventHander CancleClick;
		public event ButtonClickEventHander SaveNewClick;
		public event ButtonClickEventHander SearchClick;
		public event ButtonClickEventHander HelpClick;
		public event ButtonClickEventHander ImportClick;
		public event ButtonClickEventHander PermisionClick;
		public event ButtonClickEventHander ConstructClick;
		public event ButtonClickEventHander CopyClick;
		public event ButtonClickEventHander MirrorClick;
		public event ButtonClickEventHander ClearClick;
		public event ButtonClickEventHander ProductDetailClick;
		public event ButtonClickEventHander HistoryClick;
		public event ButtonClickEventHander InventoryClick;
		public event ButtonClickEventHander SaveDataTempClick;
		public event ButtonClickEventHander RestoreDataTempClick;
		public event ButtonClickEventHander SaveDataToFileClick;
		public event ButtonClickEventHander ReadDataFromFileClick;
		public event ButtonClickEventHander SaveLayoutClick;
		public event ButtonClickEventHander ReadLayoutClick;
		public event ButtonClickEventHander SelectAllClick;
		public event ButtonClickEventHander SaveDataByIdClick;
		public event ButtonClickEventHander ReadDataByIdClick;
		public event ButtonClickEventHander ViewClick;
		public event ButtonClickEventHander DetailViewClick;
		public event ButtonClickEventHander DetailClick;
		public event ButtonClickEventHander ViewChangedClick;
		public event ButtonClickEventHander DetailProductClick;
		public event ButtonClickEventHander DetailHistoryClick;
		public event ButtonClickEventHander DetailInventoryClick;
		public event XucBaseBarD.StockChangedEventHander StockChanged;
		public XucToolBarD Bar
		{
			get
			{
				return this.ucBar;
			}
		}
		public DateTime From
		{
			get
			{
				return this.dtFrom.DateTime;
			}
			set
			{
				this.dtFrom.DateTime = value;
			}
		}
		public DateTime To
		{
			get
			{
				return this.dtTo.DateTime;
			}
			set
			{
				this.dtTo.DateTime = value;
			}
		}
		public string Stock
		{
			get
			{
				return (this.txtStock.EditValue == null) ? "" : this.txtStock.EditValue.ToString();
			}
		}
		public string StockText
		{
			get
			{
				return this.txtStock.Text;
			}
		}
		public string Id
		{
			get
			{
				return this.txtProduct_ID.Text;
			}
			set
			{
				this.txtProduct_ID.Text = value;
			}
		}
		public new string Text
		{
			get
			{
				return this.txtProduct_Name.Text;
			}
			set
			{
				this.txtProduct_Name.Text = value;
			}
		}
		public bool IsFrom
		{
			set
			{
				this._isfrom = value;
				this.plFrom.Visible = this._isfrom;
				this.IsTo = value;
			}
		}
		public bool IsTo
		{
			set
			{
				this._isto = value;
				this.plTo.Visible = this._isto;
				this.lblTo.Visible = this._isto;
			}
		}
		public bool All
		{
			get
			{
				return this._all;
			}
			set
			{
				this._all = value;
			}
		}
		public bool IsStock
		{
			set
			{
				this.plStock.Visible = value;
			}
		}
		public bool IsProductId
		{
			set
			{
				this.plProduct_ID.Visible = value;
			}
		}
		public bool IsProductName
		{
			set
			{
				this.plProduct_Name.Visible = value;
			}
		}
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			this.components = new Container();
			ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(XucBaseBarD));
			MenuButton menuButton = new MenuButton();
			ItemCommand itemCommand = new ItemCommand();
			ItemCommand itemCommand2 = new ItemCommand();
			ItemCommand itemCommand3 = new ItemCommand();
			ItemCommand itemCommand4 = new ItemCommand();
			ItemCommand itemCommand5 = new ItemCommand();
			ItemCommand itemCommand6 = new ItemCommand();
			ItemCommand itemCommand7 = new ItemCommand();
			ItemCommand itemCommand8 = new ItemCommand();
			ItemCommand itemCommand9 = new ItemCommand();
			ItemCommand itemCommand10 = new ItemCommand();
			ItemCommand itemCommand11 = new ItemCommand();
			ItemCommand itemCommand12 = new ItemCommand();
			ItemCommand itemCommand13 = new ItemCommand();
			ItemCommand itemCommand14 = new ItemCommand();
			ItemCommand itemCommand15 = new ItemCommand();
			ItemCommand itemCommand16 = new ItemCommand();
			ItemCommand itemCommand17 = new ItemCommand();
			ItemCommand itemCommand18 = new ItemCommand();
			ItemCommand itemCommand19 = new ItemCommand();
			ItemCommand itemCommand20 = new ItemCommand();
			ItemCommand itemCommand21 = new ItemCommand();
			ItemCommand itemCommand22 = new ItemCommand();
			ItemCommand itemCommand23 = new ItemCommand();
			ItemCommand itemCommand24 = new ItemCommand();
			ItemCommand itemCommand25 = new ItemCommand();
			ItemCommand itemCommand26 = new ItemCommand();
			ItemCommand itemCommand27 = new ItemCommand();
			ItemCommand itemCommand28 = new ItemCommand();
			ItemCommand itemCommand29 = new ItemCommand();
			this.img = new ImageCollection(this.components);
			this.plMain = new PanelControl();
			this.plTo = new PanelControl();
			this.dtTo = new DateEdit();
			this.lblTo = new LabelControl();
			this.plFrom = new PanelControl();
			this.txtSelectDate = new XucDateTimeSelectEdit();
			this.dtFrom = new DateEdit();
			this.lblFrom = new LabelControl();
			this.plProduct_Name = new PanelControl();
			this.txtProduct_Name = new XucTextEdit();
			this.plProduct_ID = new PanelControl();
			this.txtProduct_ID = new XucTextEdit();
			this.plStock = new PanelControl();
			this.txtStock = new GridLookUpEdit();
			this.sTOCKBindingSource = new BindingSource(this.components);
			this.dsSTOCK = new dsSTOCK();
			this.ucLookView = new GridView();
			this.colStock_Name = new GridColumn();
			this.colStock_ID = new GridColumn();
			this.ucBar = new XucToolBarD();
			this.sTOCKTableAdapter = new STOCKTableAdapter();
			((ISupportInitialize)this.img).BeginInit();
			((ISupportInitialize)this.plMain).BeginInit();
			this.plMain.SuspendLayout();
			((ISupportInitialize)this.plTo).BeginInit();
			this.plTo.SuspendLayout();
			((ISupportInitialize)this.dtTo.Properties.VistaTimeProperties).BeginInit();
			((ISupportInitialize)this.dtTo.Properties).BeginInit();
			((ISupportInitialize)this.plFrom).BeginInit();
			this.plFrom.SuspendLayout();
			((ISupportInitialize)this.txtSelectDate.Properties).BeginInit();
			((ISupportInitialize)this.dtFrom.Properties.VistaTimeProperties).BeginInit();
			((ISupportInitialize)this.dtFrom.Properties).BeginInit();
			((ISupportInitialize)this.plProduct_Name).BeginInit();
			this.plProduct_Name.SuspendLayout();
			((ISupportInitialize)this.txtProduct_Name.Properties).BeginInit();
			((ISupportInitialize)this.plProduct_ID).BeginInit();
			this.plProduct_ID.SuspendLayout();
			((ISupportInitialize)this.txtProduct_ID.Properties).BeginInit();
			((ISupportInitialize)this.plStock).BeginInit();
			this.plStock.SuspendLayout();
			((ISupportInitialize)this.txtStock.Properties).BeginInit();
			((ISupportInitialize)this.sTOCKBindingSource).BeginInit();
			((ISupportInitialize)this.dsSTOCK).BeginInit();
			((ISupportInitialize)this.ucLookView).BeginInit();
			base.SuspendLayout();
			this.img.ImageStream = (ImageCollectionStreamer)componentResourceManager.GetObject("img.ImageStream");
			this.img.Images.SetKeyName(0, "RibbonPrintPreview_DocumentMapLarge.png");
			this.img.Images.SetKeyName(1, "101.ico");
			this.plMain.BorderStyle = BorderStyles.NoBorder;
			this.plMain.Controls.Add(this.plTo);
			this.plMain.Controls.Add(this.plFrom);
			this.plMain.Controls.Add(this.plProduct_Name);
			this.plMain.Controls.Add(this.plProduct_ID);
			this.plMain.Controls.Add(this.plStock);
			this.plMain.Dock = DockStyle.Top;
			this.plMain.Location = new Point(0, 0);
			this.plMain.Name = "plMain";
			this.plMain.Size = new Size(987, 26);
			this.plMain.TabIndex = 244;
			this.plTo.BorderStyle = BorderStyles.NoBorder;
			this.plTo.Controls.Add(this.dtTo);
			this.plTo.Controls.Add(this.lblTo);
			this.plTo.Dock = DockStyle.Left;
			this.plTo.Location = new Point(665, 0);
			this.plTo.Name = "plTo";
			this.plTo.Size = new Size(113, 26);
			this.plTo.TabIndex = 247;
			this.dtTo.EditValue = new DateTime(2009, 7, 25, 22, 57, 46, 531);
			this.dtTo.Location = new Point(24, 3);
			this.dtTo.Name = "dtTo";
			this.dtTo.Properties.Buttons.AddRange(new EditorButton[]
			{
				new EditorButton(ButtonPredefines.Combo)
			});
			this.dtTo.Properties.DisplayFormat.FormatString = "{0:dd/MM/yyyy}";
			this.dtTo.Properties.DisplayFormat.FormatType = FormatType.Custom;
			this.dtTo.Properties.EditFormat.FormatString = "{0:dd/MM/yyyy}";
			this.dtTo.Properties.EditFormat.FormatType = FormatType.Custom;
			this.dtTo.Properties.EditValueChangedFiringMode = EditValueChangedFiringMode.Buffered;
			this.dtTo.Properties.ExportMode = ExportMode.Value;
			this.dtTo.Properties.Mask.EditMask = "dd/MM/yyyy";
			this.dtTo.Properties.VistaDisplayMode = DefaultBoolean.True;
			this.dtTo.Properties.VistaEditTime = DefaultBoolean.False;
			this.dtTo.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[]
			{
				new EditorButton()
			});
			this.dtTo.Size = new Size(86, 20);
			this.dtTo.TabIndex = 237;
			this.dtTo.KeyDown += new KeyEventHandler(this.TxtProductIDKeyDown);
			this.lblTo.Location = new Point(2, 6);
			this.lblTo.Name = "lblTo";
			this.lblTo.Size = new Size(20, 13);
			this.lblTo.TabIndex = 241;
			this.lblTo.Text = "Đến";
			this.plFrom.BorderStyle = BorderStyles.NoBorder;
			this.plFrom.Controls.Add(this.txtSelectDate);
			this.plFrom.Controls.Add(this.dtFrom);
			this.plFrom.Controls.Add(this.lblFrom);
			this.plFrom.Dock = DockStyle.Left;
			this.plFrom.Location = new Point(453, 0);
			this.plFrom.Name = "plFrom";
			this.plFrom.Size = new Size(212, 26);
			this.plFrom.TabIndex = 247;
			this.txtSelectDate.DefaultText = "Tuỳ Chọn";
			this.txtSelectDate.EditValue = "Tháng này";
			this.txtSelectDate.From = new DateTime(2011, 8, 1, 0, 0, 0, 0);
			this.txtSelectDate.Location = new Point(3, 3);
			this.txtSelectDate.Name = "txtSelectDate";
			this.txtSelectDate.Properties.Appearance.ForeColor = Color.Black;
			this.txtSelectDate.Properties.Appearance.Options.UseForeColor = true;
			this.txtSelectDate.Properties.Buttons.AddRange(new EditorButton[]
			{
				new EditorButton(ButtonPredefines.Combo)
			});
			this.txtSelectDate.Properties.NullText = "Tuỳ Chọn";
			this.txtSelectDate.Properties.NullValuePrompt = "Tuỳ Chọn";
			this.txtSelectDate.Size = new Size(93, 20);
			this.txtSelectDate.TabIndex = 241;
			this.txtSelectDate.To = new DateTime(2011, 8, 31, 0, 0, 0, 0);
			this.txtSelectDate.DataTimeChanged += new XucDateTimeSelectEdit.DataTimeChangedEventHander(this.TxtSelectDateDataTimeChanged);
			this.dtFrom.EditValue = new DateTime(2009, 7, 25, 22, 57, 46, 531);
			this.dtFrom.Location = new Point(120, 3);
			this.dtFrom.Name = "dtFrom";
			this.dtFrom.Properties.Buttons.AddRange(new EditorButton[]
			{
				new EditorButton(ButtonPredefines.Combo)
			});
			this.dtFrom.Properties.DisplayFormat.FormatString = "{0:dd/MM/yyyy}";
			this.dtFrom.Properties.DisplayFormat.FormatType = FormatType.Custom;
			this.dtFrom.Properties.EditFormat.FormatString = "{0:dd/MM/yyyy}";
			this.dtFrom.Properties.EditFormat.FormatType = FormatType.Custom;
			this.dtFrom.Properties.EditValueChangedFiringMode = EditValueChangedFiringMode.Buffered;
			this.dtFrom.Properties.ExportMode = ExportMode.Value;
			this.dtFrom.Properties.Mask.EditMask = "dd/MM/yyyy";
			this.dtFrom.Properties.VistaDisplayMode = DefaultBoolean.True;
			this.dtFrom.Properties.VistaEditTime = DefaultBoolean.False;
			this.dtFrom.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[]
			{
				new EditorButton()
			});
			this.dtFrom.Size = new Size(87, 20);
			this.dtFrom.TabIndex = 236;
			this.dtFrom.KeyDown += new KeyEventHandler(this.TxtProductIDKeyDown);
			this.lblFrom.Location = new Point(101, 6);
			this.lblFrom.Name = "lblFrom";
			this.lblFrom.Size = new Size(13, 13);
			this.lblFrom.TabIndex = 240;
			this.lblFrom.Text = "Từ";
			this.plProduct_Name.BorderStyle = BorderStyles.NoBorder;
			this.plProduct_Name.Controls.Add(this.txtProduct_Name);
			this.plProduct_Name.Dock = DockStyle.Left;
			this.plProduct_Name.Location = new Point(324, 0);
			this.plProduct_Name.Name = "plProduct_Name";
			this.plProduct_Name.Size = new Size(129, 26);
			this.plProduct_Name.TabIndex = 247;
			this.plProduct_Name.Visible = false;
			this.txtProduct_Name.DefaultText = "Tên Hàng";
			this.txtProduct_Name.EditValue = "Tên Hàng";
			this.txtProduct_Name.Location = new Point(1, 3);
			this.txtProduct_Name.Name = "txtProduct_Name";
			this.txtProduct_Name.Properties.Appearance.ForeColor = Color.Black;
			this.txtProduct_Name.Properties.Appearance.Options.UseForeColor = true;
			this.txtProduct_Name.Properties.NullText = "Tên Hàng";
			this.txtProduct_Name.Properties.NullValuePrompt = "Tên Hàng";
			this.txtProduct_Name.Size = new Size(128, 20);
			this.txtProduct_Name.TabIndex = 2;
			this.txtProduct_Name.KeyDown += new KeyEventHandler(this.TxtProductIDKeyDown);
			this.plProduct_ID.BorderStyle = BorderStyles.NoBorder;
			this.plProduct_ID.Controls.Add(this.txtProduct_ID);
			this.plProduct_ID.Dock = DockStyle.Left;
			this.plProduct_ID.Location = new Point(202, 0);
			this.plProduct_ID.Name = "plProduct_ID";
			this.plProduct_ID.Size = new Size(122, 26);
			this.plProduct_ID.TabIndex = 247;
			this.plProduct_ID.Visible = false;
			this.txtProduct_ID.DefaultText = "Mã Hàng";
			this.txtProduct_ID.EditValue = "Mã Hàng";
			this.txtProduct_ID.Location = new Point(0, 3);
			this.txtProduct_ID.Name = "txtProduct_ID";
			this.txtProduct_ID.Properties.Appearance.ForeColor = Color.DarkGray;
			this.txtProduct_ID.Properties.Appearance.Options.UseForeColor = true;
			this.txtProduct_ID.Properties.NullText = "Mã Hàng";
			this.txtProduct_ID.Properties.NullValuePrompt = "Mã Hàng";
			this.txtProduct_ID.Size = new Size(121, 20);
			this.txtProduct_ID.TabIndex = 1;
			this.txtProduct_ID.KeyDown += new KeyEventHandler(this.TxtProductIDKeyDown);
			this.plStock.BorderStyle = BorderStyles.NoBorder;
			this.plStock.Controls.Add(this.txtStock);
			this.plStock.Dock = DockStyle.Left;
			this.plStock.Location = new Point(0, 0);
			this.plStock.Name = "plStock";
			this.plStock.Size = new Size(202, 26);
			this.plStock.TabIndex = 247;
			this.txtStock.Location = new Point(0, 3);
			this.txtStock.Name = "txtStock";
			this.txtStock.Properties.Appearance.ForeColor = Color.DarkGray;
			this.txtStock.Properties.Appearance.Options.UseForeColor = true;
			this.txtStock.Properties.AutoComplete = false;
			this.txtStock.Properties.BestFitMode = BestFitMode.BestFitResizePopup;
			this.txtStock.Properties.Buttons.AddRange(new EditorButton[]
			{
				new EditorButton(ButtonPredefines.Combo)
			});
			this.txtStock.Properties.DataSource = this.sTOCKBindingSource;
			this.txtStock.Properties.DisplayMember = "Stock_Name";
			this.txtStock.Properties.NullText = "Kho Hàng";
			this.txtStock.Properties.NullValuePrompt = "Kho Hàng";
			this.txtStock.Properties.TextEditStyle = TextEditStyles.Standard;
			this.txtStock.Properties.ValueMember = "Stock_ID";
			this.txtStock.Properties.View = this.ucLookView;
			this.txtStock.Size = new Size(197, 20);
			this.txtStock.TabIndex = 0;
			this.txtStock.EditValueChanged += new EventHandler(this.TxtStockEditValueChanged);
			this.txtStock.KeyDown += new KeyEventHandler(this.TxtProductIDKeyDown);
			this.sTOCKBindingSource.DataMember = "STOCK";
			this.sTOCKBindingSource.DataSource = this.dsSTOCK;
			this.dsSTOCK.DataSetName = "dsSTOCK";
			this.dsSTOCK.SchemaSerializationMode = SchemaSerializationMode.IncludeSchema;
			this.ucLookView.Columns.AddRange(new GridColumn[]
			{
				this.colStock_Name,
				this.colStock_ID
			});
			this.ucLookView.FocusRectStyle = DrawFocusRectStyle.RowFocus;
			this.ucLookView.Name = "ucLookView";
			this.ucLookView.OptionsSelection.EnableAppearanceFocusedCell = false;
			this.ucLookView.OptionsView.ShowGroupPanel = false;
			this.colStock_Name.Caption = "Kho Hàng";
			this.colStock_Name.FieldName = "Stock_Name";
			this.colStock_Name.FilterMode = ColumnFilterMode.DisplayText;
			this.colStock_Name.Name = "colStock_Name";
			this.colStock_Name.Visible = true;
			this.colStock_Name.VisibleIndex = 0;
			this.colStock_Name.Width = 740;
			this.colStock_ID.Caption = "Mã Kho";
			this.colStock_ID.FieldName = "Stock_ID";
			this.colStock_ID.FilterMode = ColumnFilterMode.DisplayText;
			this.colStock_ID.Name = "colStock_ID";
			this.colStock_ID.Visible = true;
			this.colStock_ID.VisibleIndex = 1;
			this.colStock_ID.Width = 212;
			this.ucBar.ButtonExport = BarItemVisibility.Always;
			this.ucBar.ButtonOption = BarItemVisibility.Never;
			this.ucBar.ButtonPrint = BarItemVisibility.Always;
			this.ucBar.Dock = DockStyle.Top;
			this.ucBar.IsClose = CloseOrNew.None;
			this.ucBar.Location = new Point(0, 26);
			this.ucBar.Name = "ucBar";
			this.ucBar.NotSave = false;
			itemCommand.Caption = "";
			itemCommand.Enable = false;
			itemCommand.Visibility = BarItemVisibility.Never;
			menuButton.Add = itemCommand;
			itemCommand2.Caption = "";
			itemCommand2.Enable = false;
			itemCommand2.Visibility = BarItemVisibility.Never;
			menuButton.Cancel = itemCommand2;
			itemCommand3.Caption = "";
			itemCommand3.Enable = false;
			itemCommand3.Visibility = BarItemVisibility.Never;
			menuButton.Change = itemCommand3;
			itemCommand4.Caption = "";
			itemCommand4.Enable = false;
			itemCommand4.Visibility = BarItemVisibility.Never;
			menuButton.Close = itemCommand4;
			itemCommand5.Caption = "";
			itemCommand5.Enable = false;
			itemCommand5.Visibility = BarItemVisibility.Never;
			menuButton.Custom = itemCommand5;
			itemCommand6.Caption = "";
			itemCommand6.Enable = false;
			itemCommand6.Visibility = BarItemVisibility.Never;
			menuButton.Delete = itemCommand6;
			itemCommand7.Caption = "";
			itemCommand7.Enable = false;
			itemCommand7.Visibility = BarItemVisibility.Never;
			menuButton.Export = itemCommand7;
			itemCommand8.Caption = "";
			itemCommand8.Enable = false;
			itemCommand8.Visibility = BarItemVisibility.Never;
			menuButton.Filter = itemCommand8;
			itemCommand9.Caption = "";
			itemCommand9.Enable = false;
			itemCommand9.Visibility = BarItemVisibility.Never;
			menuButton.FilterCustomer = itemCommand9;
			itemCommand10.Caption = "";
			itemCommand10.Enable = false;
			itemCommand10.Visibility = BarItemVisibility.Never;
			menuButton.FilterStock = itemCommand10;
			itemCommand11.Caption = "";
			itemCommand11.Enable = false;
			itemCommand11.Visibility = BarItemVisibility.Never;
			menuButton.Find = itemCommand11;
			menuButton.GClose = false;
			menuButton.GCommand = false;
			menuButton.GExport = false;
			itemCommand12.Caption = "";
			itemCommand12.Enable = false;
			itemCommand12.Visibility = BarItemVisibility.Never;
			menuButton.Go = itemCommand12;
			menuButton.GOption = false;
			menuButton.GPrint = false;
			menuButton.GRecords = false;
			menuButton.GSearchBar = false;
			menuButton.GSettings = false;
			menuButton.GVaildation = false;
			itemCommand13.Caption = "";
			itemCommand13.Enable = false;
			itemCommand13.Visibility = BarItemVisibility.Never;
			menuButton.Import = itemCommand13;
			itemCommand14.Caption = "";
			itemCommand14.Enable = false;
			itemCommand14.Visibility = BarItemVisibility.Never;
			menuButton.Next = itemCommand14;
			itemCommand15.Caption = "";
			itemCommand15.Enable = false;
			itemCommand15.Visibility = BarItemVisibility.Never;
			menuButton.PageSetup = itemCommand15;
			menuButton.PHome = false;
			itemCommand16.Caption = "";
			itemCommand16.Enable = false;
			itemCommand16.Visibility = BarItemVisibility.Never;
			menuButton.Previous = itemCommand16;
			itemCommand17.Caption = "";
			itemCommand17.Enable = false;
			itemCommand17.Visibility = BarItemVisibility.Never;
			menuButton.Print = itemCommand17;
			itemCommand18.Caption = "";
			itemCommand18.Enable = false;
			itemCommand18.Visibility = BarItemVisibility.Never;
			menuButton.PrintPreview = itemCommand18;
			menuButton.PTool = false;
			itemCommand19.Caption = "";
			itemCommand19.Enable = false;
			itemCommand19.Visibility = BarItemVisibility.Never;
			menuButton.Redo = itemCommand19;
			itemCommand20.Caption = "";
			itemCommand20.Enable = false;
			itemCommand20.Visibility = BarItemVisibility.Never;
			menuButton.Refresh = itemCommand20;
			itemCommand21.Caption = "";
			itemCommand21.Enable = false;
			itemCommand21.Visibility = BarItemVisibility.Never;
			menuButton.Save = itemCommand21;
			itemCommand22.Caption = "";
			itemCommand22.Enable = false;
			itemCommand22.Visibility = BarItemVisibility.Never;
			menuButton.SaveAndClose = itemCommand22;
			itemCommand23.Caption = "";
			itemCommand23.Enable = false;
			itemCommand23.Visibility = BarItemVisibility.Never;
			menuButton.SaveAndNew = itemCommand23;
			itemCommand24.Caption = "";
			itemCommand24.Enable = false;
			itemCommand24.Visibility = BarItemVisibility.Never;
			menuButton.Search = itemCommand24;
			itemCommand25.Caption = "";
			itemCommand25.Enable = false;
			itemCommand25.Visibility = BarItemVisibility.Never;
			menuButton.SearchText = itemCommand25;
			itemCommand26.Caption = "";
			itemCommand26.Enable = false;
			itemCommand26.Visibility = BarItemVisibility.Never;
			menuButton.Task = itemCommand26;
			itemCommand27.Caption = "";
			itemCommand27.Enable = false;
			itemCommand27.Visibility = BarItemVisibility.Never;
			menuButton.Undo = itemCommand27;
			itemCommand28.Caption = "";
			itemCommand28.Enable = false;
			itemCommand28.Visibility = BarItemVisibility.Never;
			menuButton.Vaildate = itemCommand28;
			itemCommand29.Caption = "";
			itemCommand29.Enable = false;
			itemCommand29.Visibility = BarItemVisibility.Never;
			menuButton.View = itemCommand29;
			this.ucBar.RibbonBar = menuButton;
			this.ucBar.Size = new Size(987, 26);
			this.ucBar.Status = Actions.None;
			this.ucBar.TabIndex = 0;
			this.ucBar.Title = "";
			this.sTOCKTableAdapter.ClearBeforeFill = true;
			base.AutoScaleDimensions = new SizeF(6f, 13f);
			base.AutoScaleMode = AutoScaleMode.Font;
			base.Controls.Add(this.ucBar);
			base.Controls.Add(this.plMain);
			this.DoubleBuffered = true;
			base.Name = "XucBaseBarD";
			base.Size = new Size(987, 54);
			((ISupportInitialize)this.img).EndInit();
			((ISupportInitialize)this.plMain).EndInit();
			this.plMain.ResumeLayout(false);
			((ISupportInitialize)this.plTo).EndInit();
			this.plTo.ResumeLayout(false);
			this.plTo.PerformLayout();
			((ISupportInitialize)this.dtTo.Properties.VistaTimeProperties).EndInit();
			((ISupportInitialize)this.dtTo.Properties).EndInit();
			((ISupportInitialize)this.plFrom).EndInit();
			this.plFrom.ResumeLayout(false);
			this.plFrom.PerformLayout();
			((ISupportInitialize)this.txtSelectDate.Properties).EndInit();
			((ISupportInitialize)this.dtFrom.Properties.VistaTimeProperties).EndInit();
			((ISupportInitialize)this.dtFrom.Properties).EndInit();
			((ISupportInitialize)this.plProduct_Name).EndInit();
			this.plProduct_Name.ResumeLayout(false);
			((ISupportInitialize)this.txtProduct_Name.Properties).EndInit();
			((ISupportInitialize)this.plProduct_ID).EndInit();
			this.plProduct_ID.ResumeLayout(false);
			((ISupportInitialize)this.txtProduct_ID.Properties).EndInit();
			((ISupportInitialize)this.plStock).EndInit();
			this.plStock.ResumeLayout(false);
			((ISupportInitialize)this.txtStock.Properties).EndInit();
			((ISupportInitialize)this.sTOCKBindingSource).EndInit();
			((ISupportInitialize)this.dsSTOCK).EndInit();
			((ISupportInitialize)this.ucLookView).EndInit();
			base.ResumeLayout(false);
		}
		public void InvokeDeleteAllClick()
		{
			ButtonClickEventHander deleteAllClick = this.DeleteAllClick;
			if (deleteAllClick != null)
			{
				deleteAllClick(this);
			}
		}
		private void RaiseStockChanged(object value)
		{
			XucBaseBarD.StockChangedEventHander stockChanged = this.StockChanged;
			if (stockChanged != null)
			{
				stockChanged(this, value);
			}
		}
		private void RaiseViewChangedClickEventHander()
		{
			if (this.ViewChangedClick != null)
			{
				this.ViewChangedClick(this);
			}
		}
		private void RaiseViewClickEventHander()
		{
			if (this.ViewClick != null)
			{
				this.ViewClick(this);
			}
		}
		private void RaiseReadLayoutClickEventHander()
		{
			if (this.ReadLayoutClick != null)
			{
				this.ReadLayoutClick(this);
			}
		}
		private void RaiseSaveLayoutClickEventHander()
		{
			if (this.SaveLayoutClick != null)
			{
				this.SaveLayoutClick(this);
			}
		}
		private void RaiseInventoryClickEventHander()
		{
			if (this.InventoryClick != null)
			{
				this.InventoryClick(this);
			}
		}
		private void RaiseHistoryClickEventHander()
		{
			if (this.HistoryClick != null)
			{
				this.HistoryClick(this);
			}
		}
		private void RaiseProductDetailClickEventHander()
		{
			if (this.ProductDetailClick != null)
			{
				this.ProductDetailClick(this);
			}
		}
		private void RaiseMirrorClickEventHander()
		{
			if (this.MirrorClick != null)
			{
				this.MirrorClick(this);
			}
		}
		private void RaiseCopyClickEventHander()
		{
			if (this.CopyClick != null)
			{
				this.CopyClick(this);
			}
		}
		private void RaiseHelpClickEventHander()
		{
			if (this.HelpClick != null)
			{
				this.HelpClick(this);
			}
		}
		private void RaiseAddClickEventHander()
		{
			if (this.AddClick != null)
			{
				this.AddClick(this);
			}
		}
		private void RaiseOptionClickEventHander()
		{
			if (this.OptionClick != null)
			{
				this.OptionClick(this);
			}
		}
		private void RaiseEditClickEventHander()
		{
			if (this.EditClick != null)
			{
				this.EditClick(this);
			}
		}
		private void RaiseDeleteClickEventHander()
		{
			if (this.DeleteClick != null)
			{
				this.DeleteClick(this);
			}
		}
		private void RaisePrintClickEventHander()
		{
			if (this.PrintClick != null)
			{
				this.PrintClick(this);
			}
		}
		private void RaiseExportEventHander()
		{
			if (this.ExportClick != null)
			{
				this.ExportClick(this);
			}
		}
		public XucBaseBarD()
		{
			this.InitializeComponent();
			this.Init();
		}
		public void StockInit()
		{
			this.sTOCKTableAdapter.Connection.ConnectionString = SqlHelper.ConnectString;
			this.sTOCKTableAdapter.Fill(this.dsSTOCK.STOCK);
			if (this._all)
			{
				DataRow dataRow = this.dsSTOCK.STOCK.NewSTOCKRow();
				dataRow["Stock_ID"] = "All";
				dataRow["Stock_Name"] = "(Tất Cả)";
				this.dsSTOCK.STOCK.Rows.InsertAt(dataRow, 0);
			}
			if (this.dsSTOCK.STOCK.Rows.Count > 0)
			{
				this.txtStock.EditValue = this.dsSTOCK.STOCK.Rows[0]["Stock_ID"].ToString();
			}
		}
		public void Init()
		{
			this.ucBar.ViewClick += new ButtonClickEventHander(this.UcToolBarViewClick);
			this.ucBar.ExportClick += new ButtonClickEventHander(this.UcToolBarExportClick);
			this.ucBar.PrintClick += new ButtonClickEventHander(this.UcToolBarPrintClick);
			this.ucBar.EditClick += new ButtonClickEventHander(this.UcToolBarEditClick);
			this.ucBar.DeleteClick += new ButtonClickEventHander(this.UcToolBarDeleteClick);
			this.ucBar.DeleteAllClick += new ButtonClickEventHander(this.UcBarDeleteAllClick);
			this.ucBar.AddClick += new ButtonClickEventHander(this.UcToolBarAddClick);
			this.ucBar.HelpClick += new ButtonClickEventHander(this.UcToolBarHelpClick);
			this.ucBar.CloseClick += new ButtonClickEventHander(this.UcToolBarCloseClick);
			this.ucBar.CopyClick += new ButtonClickEventHander(this.UcToolBarCopyClick);
			this.ucBar.MirrorClick += new ButtonClickEventHander(this.UcToolBarMirrorClick);
			this.ucBar.ProductDetailClick += new ButtonClickEventHander(this.UcToolBarProductDetailClick);
			this.ucBar.OptionClick += new ButtonClickEventHander(this.UcToolBarOptionClick);
			this.ucBar.InventoryClick += new ButtonClickEventHander(this.UcToolBarInventoryClick);
			this.ucBar.HistoryClick += new ButtonClickEventHander(this.UcToolBarHistoryClick);
			this.ucBar.SaveLayoutClick += new ButtonClickEventHander(this.UcToolBarSaveLayoutClick);
			this.ucBar.ReadLayoutClick += new ButtonClickEventHander(this.UcToolBarReadLayoutClick);
			this.dtFrom.DateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
			this.dtTo.DateTime = this.dtFrom.DateTime.AddMonths(1).AddDays(-1.0);
		}
		public void ShowProduct()
		{
			this.plProduct_ID.Visible = true;
			this.plProduct_Name.Visible = true;
			this.txtProduct_ID.Visible = true;
			this.txtProduct_Name.Visible = true;
		}
		private void UcBarDeleteAllClick(object sender)
		{
			this.InvokeDeleteAllClick();
		}
		private void UcToolBarReadLayoutClick(object sender)
		{
			this.RaiseReadLayoutClickEventHander();
		}
		private void UcToolBarSaveLayoutClick(object sender)
		{
			this.RaiseSaveLayoutClickEventHander();
		}
		private void UcToolBarHistoryClick(object sender)
		{
			this.RaiseHistoryClickEventHander();
		}
		private void UcToolBarInventoryClick(object sender)
		{
			this.RaiseInventoryClickEventHander();
		}
		private void UcToolBarOptionClick(object sender)
		{
			this.RaiseOptionClickEventHander();
		}
		private void UcToolBarProductDetailClick(object sender)
		{
			this.RaiseProductDetailClickEventHander();
		}
		private void UcToolBarMirrorClick(object sender)
		{
			this.RaiseMirrorClickEventHander();
		}
		private void UcToolBarCopyClick(object sender)
		{
			this.RaiseCopyClickEventHander();
		}
		private void UcToolBarCloseClick(object sender)
		{
			if (base.ParentForm != null)
			{
				base.ParentForm.Close();
			}
		}
		private void UcToolBarHelpClick(object sender)
		{
			this.RaiseHelpClickEventHander();
		}
		private void UcToolBarAddClick(object sender)
		{
			this.RaiseAddClickEventHander();
		}
		private void UcToolBarDeleteClick(object sender)
		{
			this.RaiseDeleteClickEventHander();
		}
		private void UcToolBarEditClick(object sender)
		{
			this.RaiseEditClickEventHander();
		}
		private void UcToolBarPrintClick(object sender)
		{
			this.RaisePrintClickEventHander();
		}
		private void UcToolBarExportClick(object sender)
		{
			this.RaiseExportEventHander();
		}
		private void UcToolBarViewClick(object sender)
		{
			this.RaiseViewClickEventHander();
		}
		private void TxtProductIDKeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Return)
			{
				this.RaiseViewChangedClickEventHander();
			}
		}
		private void TxtSelectDateDataTimeChanged(object sender, DateTime begin, DateTime To)
		{
			this.dtFrom.DateTime = begin;
			this.dtTo.DateTime = To;
		}
		private void TxtStockEditValueChanged(object sender, EventArgs e)
		{
			this.RaiseStockChanged(this.txtStock.EditValue);
		}
	}
}
